///*
//package com.atguigu.tingshu.common.configure;
//
//import com.TINGSHU.common.rabbitmq.constant.TINGSHUMqConstants;
//import org.springframework.amqp.core.*;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//@Configuration
//public class TINGSHUCloseOrderConfig {
//
//    @Bean     // 关闭订单的交换机
//    public Exchange closeOrderExchange() {
//        return ExchangeBuilder.topicExchange(TINGSHUMqConstants.TINGSHU_ORDER_EXCHANGE).build();
//    }
//
//    @Bean     // 关闭订单的队列
//    public Queue closeOrderQueue() {
//        return QueueBuilder.durable(TINGSHUMqConstants.TINGSHU_CLOSE_ORDER_QUEUE)
//                .ttl(15*60*1000)
//                .deadLetterExchange(TINGSHUMqConstants.TINGSHU_DEAD_LETTER_EXCHANGE)
//                .deadLetterRoutingKey(TINGSHUMqConstants.TINGSHU_DEAD_LETTER_ROUTING_KEY)
//                .build();
//    }
//
//    @Bean  //队列绑定交换机
//    public Binding closeOrderBinding(Queue closeOrderQueue, Exchange closeOrderExchange) {
//        return BindingBuilder.bind(closeOrderQueue).to(closeOrderExchange)
//                .with(TINGSHUMqConstants.TINGSHU_ORDER_SUBMIT_ROUTING_KEY).noargs();
//    }
//
//    @Bean   // 死信交换机
//    public Exchange deadLetterExchange() {
//        return ExchangeBuilder.topicExchange(TINGSHUMqConstants.TINGSHU_DEAD_LETTER_EXCHANGE).build();
//    }
//
//    @Bean   // 死信队列
//    public Queue deadLetterQueue() {
//        return QueueBuilder.durable(TINGSHUMqConstants.TINGSHU_DEAD_LETTER_QUEUE)
//                .ttl(60*1000).build();
//    }
//
//    @Bean  //死信队列绑定死信交换机
//    public Binding deadLetterBinding(Queue deadLetterQueue, Exchange deadLetterExchange) {
//        return BindingBuilder.bind(deadLetterQueue).to(deadLetterExchange)
//                .with(TINGSHUMqConstants.TINGSHU_DEAD_LETTER_ROUTING_KEY).noargs();
//    }
//}
//*/
